if HAVE_DOXYGEN
  DDIR = docs
endif

SUBDIRS = tests $(DDIR)

AM_CXXFLAGS = -Wall

bin_PROGRAMS = qq

qq_LDADD = @LEXLIB@

qq_SOURCES =
qq_SOURCES += numbers.hh options.hh options.cc
qq_SOURCES += S.cc S.hh
qq_SOURCES += unrootedtree.hh unrootedtree.cc
qq_SOURCES += rootedtree.hh rootedtree.cc
qq_SOURCES += dag.hh dag.cc
qq_SOURCES += unrootedtree-builder.hh unrootedtree-builder.cc
qq_SOURCES += lexer.ll
qq_SOURCES += parser.hh parser.cc
qq_SOURCES += qq.cc
qq_SOURCES += BuildFlags.hh
qq_SOURCES += PerfBlock.hh
qq_SOURCES += HashEncoder.hh
qq_SOURCES += HashTable.hh
qq_SOURCES += UnivHashFixedVector.hh


# test programs

TESTS =
TESTS += alg-test
TESTS += alg-test2
TESTS += rootedtree-test
TESTS += unrootedtree-test
TESTS += unrootedtree-builder-test
TESTS += tests/identity-test.sh
TESTS += tests/parser-test.sh
TESTS += tests/reproduce-test.sh

noinst_PROGRAMS =
noinst_PROGRAMS += alg-test 
noinst_PROGRAMS += alg-test2
noinst_PROGRAMS += dag-test
noinst_PROGRAMS += parser-test
noinst_PROGRAMS += rootedtree-test
noinst_PROGRAMS += unrootedtree-test
noinst_PROGRAMS += unrootedtree-builder-test

alg_test_SOURCES =
alg_test_SOURCES += tests/alg-test.cc
alg_test_SOURCES += numbers.hh options.hh options.cc
alg_test_SOURCES += S.cc S.hh
alg_test_SOURCES += unrootedtree-builder.hh unrootedtree-builder.cc
alg_test_SOURCES += unrootedtree.hh unrootedtree.cc
alg_test_SOURCES += rootedtree.hh rootedtree.cc
alg_test_SOURCES += dag.hh dag.cc
alg_test_SOURCES += HashEncoder.hh
alg_test_SOURCES += HashTable.hh
alg_test_SOURCES += UnivHashFixedVector.hh

alg_test2_SOURCES =
alg_test2_SOURCES += tests/alg-test2.cc
alg_test2_SOURCES += numbers.hh options.hh options.cc
alg_test2_SOURCES += S.cc S.hh
alg_test2_SOURCES += unrootedtree-builder.hh unrootedtree-builder.cc
alg_test2_SOURCES += unrootedtree.hh unrootedtree.cc
alg_test2_SOURCES += rootedtree.hh rootedtree.cc
alg_test2_SOURCES += dag.hh dag.cc
alg_test2_SOURCES += HashEncoder.hh
alg_test2_SOURCES += HashTable.hh
alg_test2_SOURCES += UnivHashFixedVector.hh

dag_test_SOURCES =
dag_test_SOURCES += tests/dag-test.cc
dag_test_SOURCES += numbers.hh options.hh options.cc
dag_test_SOURCES += S.cc S.hh
dag_test_SOURCES += unrootedtree.hh unrootedtree.cc
dag_test_SOURCES += rootedtree.hh rootedtree.cc
dag_test_SOURCES += dag.hh dag.cc
dag_test_SOURCES += HashEncoder.hh
dag_test_SOURCES += HashTable.hh
dag_test_SOURCES += UnivHashFixedVector.hh

parser_test_LDADD = @LEXLIB@
parser_test_SOURCES =
parser_test_SOURCES += tests/parser-test.cc
parser_test_SOURCES += S.cc S.hh
parser_test_SOURCES += rootedtree.hh rootedtree.cc
parser_test_SOURCES += dag.hh dag.cc
parser_test_SOURCES += HashEncoder.hh
parser_test_SOURCES += HashTable.hh
parser_test_SOURCES += UnivHashFixedVector.hh
parser_test_SOURCES += unrootedtree.hh unrootedtree.cc
parser_test_SOURCES += unrootedtree-builder.hh unrootedtree-builder.cc
parser_test_SOURCES += lexer.ll
parser_test_SOURCES += options.hh options.cc
parser_test_SOURCES += parser.hh parser.cc

rootedtree_test_SOURCES =
rootedtree_test_SOURCES += tests/rootedtree-test.cc
rootedtree_test_SOURCES += numbers.hh options.hh options.cc
rootedtree_test_SOURCES += S.cc S.hh
rootedtree_test_SOURCES += unrootedtree.hh unrootedtree.cc
rootedtree_test_SOURCES += rootedtree.hh rootedtree.cc

unrootedtree_test_SOURCES =
unrootedtree_test_SOURCES += tests/unrootedtree-test.cc
unrootedtree_test_SOURCES += numbers.hh options.hh options.cc
unrootedtree_test_SOURCES += S.cc S.hh
unrootedtree_test_SOURCES += unrootedtree.hh unrootedtree.cc

unrootedtree_builder_test_SOURCES =
unrootedtree_builder_test_SOURCES += tests/unrootedtree-builder-test.cc
unrootedtree_builder_test_SOURCES += S.cc S.hh
unrootedtree_builder_test_SOURCES += options.hh options.cc
unrootedtree_builder_test_SOURCES += unrootedtree.hh unrootedtree.cc
unrootedtree_builder_test_SOURCES += unrootedtree-builder.hh unrootedtree-builder.cc

# Add in performance trace appropriate to platform

if LINUX
qq_SOURCES += PerfLinux.cc
alg_test_SOURCES += PerfLinux.cc
alg_test2_SOURCES += PerfLinux.cc
dag_test_SOURCES += PerfLinux.cc
parser_test_SOURCES += PerfLinux.cc
else
if OSX
qq_SOURCES += PerfOSX.cc
alg_test_SOURCES += PerfOSX.cc
alg_test2_SOURCES += PerfOSX.cc
dag_test_SOURCES += PerfOSX.cc
parser_test_SOURCES += PerfOSX.cc
else
qq_SOURCES += PerfDummy.cc
alg_test_SOURCES += PerfDummy.cc
alg_test2_SOURCES += PerfDummy.cc
dag_test_SOURCES += PerfDummy.cc
parser_test_SOURCES += PerfDummy.cc
endif
endif

